<%--
  Created by IntelliJ IDEA.
  User: Administrator
  Date: 2020/3/22
  Time: 14:52
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>
<html lang="zh">
<head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no" />
    <title>评论管理</title>
    <link rel="icon" href="${pageContext.request.contextPath}/static/images/favicon.ico" type="image/ico">
    <meta name="keywords" content="网络笔记">
    <meta name="description" content="">
    <meta name="author" content="yinqi">
    <link href="${pageContext.request.contextPath}/static/css/bootstrap.min.css" rel="stylesheet">
    <link href="${pageContext.request.contextPath}/static/css/materialdesignicons.min.css" rel="stylesheet">
    <link rel="stylesheet" href="${pageContext.request.contextPath}/static/js/bootstrap-multitabs/multitabs.min.css">
    <link href="${pageContext.request.contextPath}/static/css/style.min.css" rel="stylesheet">
</head>

<body>
<div class="container-fluid p-t-15">

    <div class="row">
        <div class="col-lg-12">
            <div class="card">
                <div class="card-toolbar clearfix">
                    <form class="pull-right search-bar" method="get" action="#!" role="form">
                        <div class="input-group">
                            <div class="input-group-btn">
                                <input type="hidden" name="search_field" id="search-field" value="title">
                                <button class="btn btn-default dropdown-toggle" id="search-btn" data-toggle="dropdown" type="button" aria-haspopup="true" aria-expanded="false">
                                    标题 <span class="caret"></span>
                                </button>
                                <ul class="dropdown-menu">
                                    <li> <a tabindex="-1" href="javascript:void(0)" data-field="title">标题</a> </li>
                                    <li> <a tabindex="-1" href="javascript:void(0)" data-field="cat_name">栏目</a> </li>
                                </ul>
                            </div>
                            <input type="text" class="form-control" value="" name="keyword" placeholder="请输入名称">
                        </div>
                    </form>
                    <div class="toolbar-btn-action">
                        <span>评论管理</span>
                    </div>
                </div>
                <div class="card-body">

                    <div class="table-responsive">
                        <table class="table table-bordered">
                            <thead>
                            <tr>
                                <th>标题</th>
                                <th>创建时间</th>
                                <th>操作</th>
                            </tr>
                            </thead>
                            <tbody>
                            <c:forEach var="note" items="${pageInfo.list}">
                                <tr>
                                    <td>${note.getTitle()}</td>
                                    <td><fmt:formatDate value="${note.getCreatetime()}" pattern="yyyy-MM-dd HH:mm:ss"/></td>
                                    <td>
                                        <a href="${pageContext.request.contextPath}/?id=">阅读</a>

                                    </td>
                                </tr>
                            </c:forEach>
                            </tbody>
                        </table>
                    </div>
                    <ul class="pagination">
                        <li class="active"><a href="${pageContext.request.contextPath}/note/notesit?pn=1&type=0">首页</a></li>
                        <c:if test="${pageInfo.hasPreviousPage }">
                            <li><a href="${pageContext.request.contextPath}/note/notesit?type=0&pn=${pageInfo.pageNum-1}"
                                   aria-label="Previous"> <span aria-hidden="true">&laquo;</span>
                            </a></li>
                        </c:if>


                        <c:forEach items="${pageInfo.navigatepageNums }" var="page_Num">
                            <c:if test="${page_Num == pageInfo.pageNum }">
                                <li class="active"><a href="#">${page_Num }</a></li>
                            </c:if>
                            <c:if test="${page_Num != pageInfo.pageNum }">
                                <li><a href="${pageContext.request.contextPath}/note/notesit?type=0&pn=${page_Num }">${page_Num }</a></li>
                            </c:if>

                        </c:forEach>
                        <c:if test="${pageInfo.hasNextPage }">
                            <li><a href="${pageContext.request.contextPath}/note/notesit?type=0&pn=${pageInfo.pageNum+1 }"
                                   aria-label="Next"> <span aria-hidden="true">&raquo;</span>
                            </a></li>
                        </c:if>
                        <li><a href="${pageContext.request.contextPath}/note/notesit?type=0&pn=${pageInfo.pages }">末页</a></li>
                    </ul>

                </div>
            </div>
        </div>

    </div>

</div>

<script type="text/javascript" src="${pageContext.request.contextPath}/static/js/jquery.min.js"></script>
<script type="text/javascript" src="${pageContext.request.contextPath}/static/js/bootstrap.min.js"></script>
<script type="text/javascript" src="${pageContext.request.contextPath}/static/js/main.min.js"></script>
<script type="text/javascript">
    $(function(){
        $('.search-bar .dropdown-menu a').click(function() {
            var field = $(this).data('field') || '';
            $('#search-field').val(field);
            $('#search-btn').html($(this).text() + ' <span class="caret"></span>');
        });
    });
</script>
</body>
</html>
